package com.hex.ds.hdrs.log.dao;

import com.hex.bigdata.hbda.base.BaseDao;
import com.hex.bigdata.hbda.base.Page;
import com.hex.ds.hdrs.log.po.RunningStateLog;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;


@Repository
public class RunningStateLogDao extends BaseDao {

    public List<RunningStateLog> queryrunningStateLog(Map map, Page page) {
        return this.selectPage(RunningStateLog.class, "com.hex.ds.hdrs.log.dao.RunningStateLogDao.selectPages", page, map);
    }

    public List<RunningStateLog> selectPages(Page page) {
        return this.selectPage(RunningStateLog.class, "com.hex.ds.hdrs.log.dao.RunningStateLogDao.selectPages", page);
    }

    public List<RunningStateLog> selectAgentStates(String agentCode) {
        return this.selectList(RunningStateLog.class, "com.hex.ds.hdrs.log.dao.RunningStateLogDao.selectAgentStates", agentCode);
    }

    public List<RunningStateLog> findRunningStateLog(Map paramMap) {
        return this.selectList(RunningStateLog.class, "com.hex.ds.hdrs.log.dao.RunningStateLogDao.findRunningStateLog", paramMap);
    }

    public List<RunningStateLog> findRunningStateLogByAppCode(String appCode, Page page) {
        return this.selectPage(RunningStateLog.class, "com.hex.ds.hdrs.log.dao.RunningStateLogDao.findRunningStateLogByAppCode", page, appCode);
    }

    public List<RunningStateLog> qryRunningStateLogByUser(Map map, Page page) {
        return this.selectPage(RunningStateLog.class, "com.hex.ds.hdrs.log.dao.RunningStateLogDao.qryRunningStateLogByUser", page, map);
    }

    public void addRunningStatusLog(RunningStateLog runningStateLog) {
        this.insert("com.hex.ds.hdrs.log.dao.RunningStateLogDao.insert", runningStateLog);
    }

    public List<RunningStateLog> initMasterRunningStateLog(String srcType, Page page) {
        return this.selectPage(RunningStateLog.class, "com.hex.ds.hdrs.log.dao.RunningStateLogDao.initMasterRunningStateLog", page
                , srcType);
    }

    public RunningStateLog getLastTimeLog(RunningStateLog log) {
        return this.selectOne(RunningStateLog.class, "com.hex.ds.hdrs.log.dao.RunningStateLogDao.getLastTimeLog", log);
    }

    public void update(Map map) {
        this.update("com.hex.ds.hdrs.log.dao.RunningStateLogDao.update", map);
    }

    public List<RunningStateLog> getAgentOnAndOffline(Map map) {
        return this.selectList(RunningStateLog.class, "com.hex.ds.hdrs.log.dao.RunningStateLogDao.getAgentOnAndOffline", map);
    }

    public Integer checkLogExist(Map map) {
        return this.selectOne(Integer.class, "com.hex.ds.hdrs.log.dao.RunningStateLogDao.checkLogExist", map);
    }

    public void delTaskByDate(Map map) {
        this.delete("com.hex.ds.hdrs.log.dao.RunningStateLogDao.delTaskByDate", map);
    }

    public void reductionRunningStateLog(String bitchId) {
        this.insert("com.hex.ds.hdrs.log.dao.RunningStateLogDao.reductionRunningStateLog", bitchId);
    }
}